<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>select.html</title>
<script>
	window.onload=function(){
		var btn=document.getElementById("btnchk");
		var ss=document.getElementById("sel");
		btn.onclick=function(){
			var s=frm.sel;
			var pos=s.selectedIndex;
			alert(s.selectedIndex+"번째가 선택됨"+" 선택된 항목은 "+s[pos].text);
		}
	}


</script>

<style>


</style>



</head>
<body>
<h1>Select 상자 제어하기</h1>
<form name='frm' action='' method='post'>
<h3>수강하실 과목을 선택하세요.</h3>
<select name='sel' size='1' id='sel'>
	<option value='HTML'>HTML</option>
	<option value='CSS'>CSS</option>
	<option value='JAVASCRIPT'>JAVASCRIPT</option>
	<option value='JSP'>JSP</option>
	<option value='AJAX'>AJAX</option>
	
</select>
<p/>

<input type='button' value='선택' id='btnchk'>

</form>

</body>
</html>